package com.readbook.service;

import com.readbook.dao.JfychDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class JfychService {
    @Autowired
    private JfychDao jfychdao;

    public List<Map<String, Object>> getJfych() {
        List<Map<String, Object>> list1 = jfychdao.getJfych();
        List<Map<String, Object>> list2 = new ArrayList<>();
        for (int i = 0; i < list1.size(); i++) {
            Map<String, Object> maps = list1.get(i);
            Map<String, Object> maps1 = new HashMap<>();
            maps1.put("minjf", maps.get("MINJF"));
            maps1.put("maxjf", maps.get("MAXJF"));
            maps1.put("ch", maps.get("CH"));
            list2.add(maps1);
        }
        return list2;
    }

    public int del_Jfych() {
        return jfychdao.del_Jfych();
    }


    public int add_Jfych(Map<String, Object> gmap) {
        return jfychdao.add_Jfych(gmap);
    }


    public List<Map<String, Object>> getlunboPic(Map<String, Object> gmap) {
        List<Map<String, Object>> list1 = jfychdao.getlunboPic(gmap);
        return list1;
    }

    public int delLunboPic(Map<String, Object> gmap) {
        return jfychdao.delLunboPic(gmap);
    }

    public int add_picture(Map<String, Object> gmap) {
        return jfychdao.add_picture(gmap);
    }

}


